﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace yaai
{
    public partial class addMode : Form
    {

        public grunkaListController glc;
        
        public List<WordList> lists;

        public addMode(List<WordList> l)
        {
            lists = l;
            InitializeComponent();
            glc = new grunkaListController(lists);
            glc.changeOrientation += new EventHandler(glc_changeOrientation);
            this.Controls.Add(glc);
            this.glc.Location = new System.Drawing.Point(100, 5);
            this.glc.Name = "grunkaController";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form.ActiveForm.Size = new Size(Form.ActiveForm.Size.Width + 10, Form.ActiveForm.Size.Height + 10);
        }

        public void glc_changeOrientation(object sender, EventArgs e)
        {
            Form.ActiveForm.Size = new Size(Form.ActiveForm.Size.Height, Form.ActiveForm.Size.Width);
        }

        private void btn_GenText_Click(object sender, EventArgs e)
        {
            txtGenMessage.Text = glc.genereteTextMessage();
        }

        private void btn_simpleGrunkaTest_Click(object sender, EventArgs e)
        {
            List<simpleGrunka> test = glc.getSimpleGrunkor();
            txtGenMessage.Text = "";
            foreach(simpleGrunka sg in test)
            {
                txtGenMessage.Text += " " + sg.getDescriptor();
            }
        }
    }
}
